<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../../common/header.jsp"/>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>

<script type="text/javascript">

function check() {
	document.getElementById('ok').disabled = 'disabled';
}

function backcompanylist(){
	$("#companyform").attr("action","<%=request.getContextPath()%>/sso/company/list");
	$("#companyform").submit();
}
</script>
</head>
<body class="page-header-fixed page-full-width">

		<div class="page-content">

			<div class="container-fluid">

				<div class="row-fluid">

					<div class="span12">


						<h3 class="page-title">

							<!--系统用户管理 <small>欢迎您，admin!</small> -->

						</h3>

						<ul class="breadcrumb">

							<li><i class="icon-home"></i> <a href="index.html">Home</a>

								<i class="icon-angle-right"></i></li>

							<li><a href="#">单点登录系统</a> <i class="icon-angle-right"></i>

							</li>

							<li><a href="#">企业管理</a></li>

						</ul>



					</div>

				</div>

				<div class="portlet-body form">
					<c:if test="${success==false}">
						<div class="alert alert-failure">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="failure"></spring:message>!</strong>
							${errorMsg}
						</div>
					</c:if>
					<c:if test="${success }">
						<div class="alert alert-success">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="success"></spring:message>!</strong>
							<spring:message code="save success"></spring:message>
							!
						</div>
					</c:if>

					<h3 class="page-title">
						<c:if test="${oauthCompany.oauthCompanyId==null }">
							新增企业
						</c:if>
						<c:if test="${oauthCompany.oauthCompanyId!=null }">
							编辑企业
						</c:if>
					</h3>

					<form
						action="<c:if test="${oauthCompany.oauthCompanyId==null}">insert</c:if>
				<c:if test="${oauthCompany.oauthCompanyId!=null}">edit</c:if>"
						method="post" class="form-horizontal" id="companyform"
						onsubmit="return check();">
						<input type="hidden" name="searchValue" value="${searchValue}" />
						<input type="hidden" name="id"
							value="${oauthCompany.oauthCompanyId}"></input> <input
							type="hidden" name="token" value="${token}"></input>

						<div class="control-group">
							<label class="control-label">企业编号：</label>
							<div class="controls">

								<input type="text" maxLength="30"
									<c:if test="${oauthCompany.oauthCompanyId!=null}">disabled="disabled"</c:if>
									name="companyCode" value="${oauthCompany.companyCode }"
									class="m-wrap" required />
								<c:if test="${oauthCompany.oauthCompanyId!=null}">

									<input type="hidden" name="companyCode"
										value="${oauthCompany.companyCode }"></input>
								</c:if>

								<span class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label">企业中文名称：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="companyNameCn"
									value="${oauthCompany.companyNameCn}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label">企业英文名称：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="companyNameEn"
									value="${oauthCompany.companyNameEn}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label">企业地址：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="companyAddr"
									value="${oauthCompany.companyAddr}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label">企业规模：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="scale"
									value="${oauthCompany.scale}" class="m-wrap" required /> <span
									class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label">被授权：</label>
							<div class="controls">
								<label class="radio"> <input type="radio"
									<c:if test="${oauthCompany.isEnable==1}">checked="checked"</c:if>
									name="isEnable" value="1" /> <spring:message code="yes"></spring:message>

								</label> <label class="radio"> <input type="radio"
									name="isEnable"
									<c:if test="${oauthCompany.isEnable==0 || oauthCompany.oauthCompanyId==null}">checked="checked"</c:if>
									value="0" /> <spring:message code="no"></spring:message>

								</label>
							</div>

						</div>
						<div class="control-group">
							<label class="control-label">备注：</label>
							<div class="controls">
								<input type="text" maxlength="250" name="sremark"
									value="${oauthCompany.sremark }" class="m-wrap" required /> <span
									class="help-inline"></span>

							</div>

						</div>

						<div class="form-actions">

							<button type="submit" id="ok" class="btn blue">
								<spring:message code="btn.common.save"></spring:message>
							</button>
							<button type="button" onclick="backcompanylist();" class="btn">
								<spring:message code="btn.common.back"></spring:message>
							</button>

						</div>

					</form>

				</div>



			</div>
		</div>

</body>
</html>